{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"https://raw.githubusercontent.com/Qiskit/qiskit-tutorials/master/images/qiskit-heading.png\" alt=\"Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook\" width=\"500 px\" align=\"left\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# _*QISKIT for quantum machine learning*_ \n",
    "This tutorial is about how to use QISKIT(created by IBMQ) to realize quantum machine learning algorithoms on the quantum processer provided by IBMQ. The machine learning algorithms include K-means methood and support vector machines(SVM). We also discuss the Harrow-Hassidim-Lloyd(HHL) Algorithm for solving system of linear equations, which is useful to implment the quantum SVM algorithm and quantum optimization algorithms such as gradient-decent and Newton methods.\n",
    "\n",
    "***\n",
    "### Contributors \n",
    "Shan Jin, Xi He, Xiaokai Hou, Li Sun, Dingding Wen, Shaojun Wu and Xiaoting Wang$^{1}$\n",
    "\n",
    "1. Institute of Fundamental and Frontier Sciences, University of Electronic Science and Technology of China，Chengdu, China，610051\n",
    "***"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Introduction\n",
    "Quantum machine learning is an interactional topics that arises from the intersection of quantum computing and machine learning. The development of this field is mainly reflected in two aspects: on the one hand, machine learning provides more research methods and applications for us to understand and control quantum systems; on the other hand, the development of quantum computing techniques makes the quantum acceleration of the classical machine learning algorithm possible and greatly expands the scope of machine learning applications and computational effectiveness . We can say that in this vibrant area, quantum computing and machine learning promote each other and make progress together.<br \\>\n",
    "Quantum machine learning is the use of quantum effects to machine learning algorithms, such as: supervised learning, unsupervised learning algorithms, etc. run on a quantum computer. Quantum machine learning algorithms can achieve significant speedup when compared to classical machine learning algorithms when dealing with many tasks (clustering, classification, etc.).<br \\>\n",
    "In a word, Quantum machine learning is an emerging interdisciplinary research area at the intersection of quantum physics and machine learning.Quantum machine learning algorithms can use the advantages of quantum computation in order to improve classical methods of machine learning, for example by developing efficient implementations of expensive classical algorithms on a quantum computer. In this tutorial, we will achieve some simple machine learning algorithms via qiskit.\n",
    "\n",
    "This tutoprial is organized into the following topics:\n",
    "1. [Quantum K-Means algorithm](#section1)\n",
    "2. [Quantum algorithm for linear system of equation](#section2)\n",
    "3. [Quantum support vector machine](#section3)\n",
    "4. [Future work](#section4)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1. Quantum K-Means algorithm<a id='section1'></a>\n",
    "In this section, we mainly introduce a kind of unsupervised learning algorithms called K-Means.\n",
    "#### Classical K-Means algorithm\n",
    "K-Means algoruthm is a method of vector quantization, originally from signal processing, that is popular for cluster analysis in data mining.K-Means aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean, serving as a prototype of the cluster. k-means clustering tends to find clusters of comparable spatial extent.Given a set of observations$\\left( {{x_1},{x_2},...,{x_n}} \\right)$, where each observation is a d-dimensional real vector, and k-means clustering divides the n observations into k(k ≤ n) sets $S = \\{ {S_1},{S_2},...,{S_k}\\}$ so as to minimize the within-cluster sum of squares. In other words, its goal is to find the cluster that satisfies:\n",
    "$\\arg \\mathop {\\min }\\limits_S {\\sum\\limits_{i = 1}^k {\\sum\\limits_{X \\in {S_i}} {\\left\\| {X - {\\mu _i}} \\right\\|} } ^2}$\n",
    "where ${{\\mu _i}}$ is the mean of points in ${{S _i}}$\n",
    "#### Quantum K-Means algorithm\n",
    "* [Quantum K-Means algorithm](1_K_Means/Quantum K-Means Algorithm.ipynb)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.Quantum algorithm for linear system of equations(HHL algorithm)<a id='section2'></a>\n",
    "In this section, we will introduce the quantum algorithm for linear system of equatoins . This algorithm is a useful tool to solve linear systems of equations and also a powerful method to achieve some quantum machine learning algorithm such as SVM.\n",
    "* [Quantum algorithm for linear system of equation](2_HHL/Quantum Algorithm for Linear System of Equations.ipynb) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3.Quantum support vector machine (to be continued )<a id='section3'></a>\n",
    "This section is mainly about quantum support vector machine(SVM).\n",
    "\n",
    "#### Support vector machine algorithm(SVM)\n",
    "Support Vector Machine (SVM) is a kind of supervised learning method, which can be widely used in statistical classification and regression analysis. It was first proposed by Corinna Cortes and Vapnik in 1995. It shows many unique advantages in solving small sample, nonlinear and high dimensional pattern recognition, and can be applied to the function fitting other machine learning problems. The characteristic of this classifier is that they can minimize both the experience error and the maximized geometric marginal area, so the support vector machine is also referred to as the maximum marginal zone classifier.\n",
    "\n",
    "#### Quantum support vector machine algorithm\n",
    "* [Quantum vector machine algorithm](3_SVM/Quantum Support Vector Machine.ipynb)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4.Future work<a id='section4'></a>\n",
    "Quantum machine learning has been widely used in many fields. Many excellent results have been achieved in solving optimization problems such as gradient descent and Newton method. Besides, there are also a lot of superior work in feature extraction, data reduction, and so on. Recently, some heuristic results have been achieved in the research of neural network and deep learning. Therefore, quantum machine learning has a broad prospect in the future and deserves much more in-depth research."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
